home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 November: Tool Chest / Dev.CD Nov 98 TC.toast / Sample Code / Snippets / QuickDraw / QuickDraw™ FX / about.c next >
Encoding:
C/C++ Source or Header  |  1993-03-10  |  2.4 KB  |  116 lines  |  [TEXT/KAHL]

  1. #include "FX.h"
  2.  
  3. #define    WWIDTH        420
  4. #define    WHEIGHT        200
  5.  
  6. #define WLEFT        (((screenBits.bounds.right - screenBits.bounds.left) - WWIDTH) / 2)
  7. #define WTOP        (((screenBits.bounds.bottom - screenBits.bounds.top) - WHEIGHT) / 2)
  8.  
  9. void drawMyString();
  10.  
  11. void doAboutBox()
  12. {
  13.     int                col, row;
  14.     int                width, height;
  15.     WindowPtr        window;
  16.     CIconHandle        cicn;
  17.     Rect            rect;
  18.     RGBColor        color;
  19.  
  20.     cicn = GetCIcon( 128 );
  21.     HPurge( cicn );
  22.  
  23.     SetRect( &rect, WLEFT, WTOP, WLEFT + WWIDTH, WTOP + WHEIGHT );
  24.     window = NewCWindow( 0L, &rect, "\p", true, plainDBox, (WindowPtr)-1L, false, 0L );                            
  25.     SetPort( window );
  26.         
  27.     TextFont( geneva );
  28.     TextMode( srcOr );
  29.     
  30.     color.red = color.green = color.blue = 8700;
  31.     RGBForeColor( &color );
  32.         
  33.     rect = window->portRect;
  34.     InsetRect( &rect, 1, 1 );
  35.     PaintRect( &rect );
  36.     
  37.     width = 32 * 6;
  38.     height = width;
  39.     
  40.     SetRect( &rect, 3, 3, width + 3, height + 3 );
  41.     PlotCIcon( &rect, cicn );
  42.  
  43.     ForeColor( blackColor );
  44.  
  45.     for (row = 6; row < height; row += 6)
  46.     {
  47.         MoveTo( rect.left, rect.top + row );
  48.         LineTo( rect.left + width, rect.top + row );
  49.     }
  50.     
  51.     for (col = 6; col < width; col += 6)
  52.     {
  53.         MoveTo( rect.left + col, rect.top );
  54.         LineTo( rect.left + col, rect.top + height );
  55.     }
  56.     
  57.     col = width + 15;
  58.     row = 35;
  59.     
  60.     TextFont( times );
  61.     TextSize( 36 );
  62.     
  63.     color.blue = 0xffff;
  64.     color.red = color.green = 0;
  65.     RGBForeColor( &color );    
  66.     drawMyString( col, &row, 30, "\pQuickDraw™" );
  67.     
  68.     color.blue = 0x9fff;
  69.     RGBForeColor( &color );
  70.     drawMyString( col + 45, &row, -5, "\pFX" );
  71.     
  72.     TextFont( geneva );
  73.     TextSize( 9 );
  74.     ForeColor( whiteColor );
  75.     
  76.     col += 10;
  77.     
  78.     drawMyString( col + 115, &row, 25, "\pVersion 1.0" );
  79.     drawMyString( col, &row, 20, "\pBrought to you by Edgar Lee." );
  80.     
  81.     drawMyString( col, &row, 13, "\pFor any suggestions or comments," );
  82.     drawMyString( col, &row, 13, "\pplease write to edgar@apple.com" );
  83.     drawMyString( col, &row, 20, "\por appleLink EDGAR." );
  84.     
  85.     drawMyString( col, &row, 15, "\p© 1992 Apple Computer, Inc." );
  86.     drawMyString( col, &row, 25, "\pAll rights reserved." );
  87.     
  88.     TextFont( times );
  89.     TextSize( 36 );
  90.     
  91.     ForeColor( redColor );
  92.     drawMyString( col + 125, &row, 0, "\pDTS" );
  93.     
  94.     while (!Button());
  95.     
  96.     DisposeWindow( window );
  97. }
  98.  
  99. void drawMyString( col, row, increment, string )
  100. int        col, *row, increment;
  101. Str255    string;
  102. {
  103.     RGBColor    color;
  104.     
  105.     GetForeColor( &color );
  106.     
  107.     ForeColor( blackColor );
  108.     MoveTo( col + 2, *row + 2 );
  109.     DrawString( string );
  110.     
  111.     RGBForeColor( &color );
  112.     MoveTo( col, *row );
  113.     DrawString( string );
  114.     
  115.     *row += increment;
  116. }